#include <iostream>
#include <vector>
#include <climits>
using ll=long long;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    if (n == 0) {
        cout << 0 << endl;
        return 0;
    }
    
    vector<ll> a(n), b(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    for (int i = 0; i < n; ++i) cin >> b[i];
    
    vector<ll> prefix_a(n + 1, 0), prefix_b(n + 1, 0);
    for (int i = 0; i < n; ++i) {
        prefix_a[i + 1] = prefix_a[i] + a[i];
        prefix_b[i + 1] = prefix_b[i] + b[i];
    }
    
    ll sum_a_total = prefix_a[n];
    ll sum_b_total = prefix_b[n];
    
    ll min_a_to_b = LLONG_MAX;
    for (int i = 0; i <= n; ++i) {
        ll current = prefix_a[i] + (sum_b_total - prefix_b[i]);
        if (current < min_a_to_b) min_a_to_b = current;
    }
    
    ll min_b_to_a = LLONG_MAX;
    for (int i = 0; i <= n; ++i) {
        ll current = prefix_b[i] + (sum_a_total - prefix_a[i]);
        if (current < min_b_to_a) min_b_to_a = current;
    }
    
    cout << min(min_a_to_b, min_b_to_a) << endl;
    
    return 0;
}
